#include <iostream>
using namespace std;
bool isContinousCards(int arr[])
{
	if(arr == nullptr)
		return false;
	//插入排序
	int j = 1;
	while(j < 5)
	{
		int val = arr[j],i = j;
		for(; i > 0 && val < arr[i-1]; --i)
			arr[i] = arr[i-1];
		arr[i] = val;
		++j;
	}
	for(int i = 0 ; i < 5 ;++i)
		cout<<arr[i]<<",";
	cout<<endl;
	int zero = 0, val = 0;
	for(int i = 0 ; i < 4 ; ++i)
	//统计0的个数
		if(arr[i] == 0)
			++zero;
	//统计间隔数
		else if(arr[i+1] - arr[i] == 0)
			return false;
		else
		{
			val+=arr[i+1] - arr[i] -1;
		}
	cout<<"zero : "<<zero<<endl;
	cout<<"val : "<<val<<endl;

	if(zero >= val)
		return true;
	return false;
}

int main()
{
	int arr1[] = {13,0,2,0,0};
	int arr2[] = {13,10,0,11,9};
	int arr3[] = {6,4,5,8,7};
	int arr4[] = {3,3,5,6,7};
	cout<<isContinousCards(arr1)<<endl;
	cout<<isContinousCards(arr2)<<endl;
	cout<<isContinousCards(arr3)<<endl;
	cout<<isContinousCards(arr4)<<endl;


	return 0;
}